home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / modelers / geomview / sgi.lha / Geomview / include / pickfunc.h < prev   
Text File  |  1993-08-18  |  2KB  |  81 lines

  1. #define PICKFUNC(name, maxfaceverts, maxpathlen, body)        \
  2. LObject *name(Lake *lake, LList *args)                \
  3. {                                \
  4.   char *coordsys = NULL, *id = NULL;                \
  5.   HPoint3 point;  int pn = 4;                    \
  6.   HPoint3 vertex; int vn = 4;                    \
  7.   HPoint3 edge[2]; int en = 8;                    \
  8.   HPoint3 face[maxfaceverts]; int fn = maxfaceverts*4;        \
  9.   int ppath[maxpathlen]; int ppn = maxpathlen;            \
  10.   int vi;                            \
  11.   int ei[2]; int ein = 2;                    \
  12.   int fi;                            \
  13.                                 \
  14.   LDECLARE(("pick", LBEGIN,                    \
  15.         LSTRING,            &coordsys,        \
  16.         LSTRING,            &id,            \
  17.         LHOLD, LARRAY, LFLOAT,    &point, &pn,        \
  18.         LHOLD, LARRAY, LFLOAT,    &vertex, &vn,        \
  19.         LHOLD, LARRAY, LFLOAT,    edge, &en,        \
  20.         LHOLD, LARRAY, LFLOAT,    face, &fn,        \
  21.         LHOLD, LARRAY, LINT,    ppath, &ppn,        \
  22.         LINT,            &vi,            \
  23.         LHOLD, LARRAY, LINT,    ei, &ein,        \
  24.         LINT,            &fi,            \
  25.         LEND));                        \
  26.                                 \
  27.   if (1) { body };                        \
  28.   return Lt;                            \
  29. }
  30.  
  31. /*
  32.   Note: the "if (1)" business above is to prevent a warning
  33.   about the following statement ("return Lt") not being reached
  34.   if the body itself returns.
  35. */
  36.  
  37. /* Note: Don't use DEFPICKFUNC any more.  Use the newer PICKFUNC
  38.  * instead.  DEFPICKFUNC is provided for backward compatibility.
  39.  */
  40. #define DEFPICKFUNC(helpstr,                    \
  41.             coordsys,                    \
  42.             id,                        \
  43.             point, pn,                    \
  44.             vertex, vn,                    \
  45.             edge, en,                    \
  46.             face, fn, maxfaceverts,            \
  47.             ppath, ppn, maxpathlen,            \
  48.             vi,                        \
  49.             ei, ein,                    \
  50.             fi,                        \
  51.             body)                    \
  52. LDEFINE(pick, LVOID, helpstr)                    \
  53. {                                \
  54.   char *coordsys = NULL, *id = NULL;                \
  55.   HPoint3 point;  int pn = 4;                    \
  56.   HPoint3 vertex; int vn = 4;                    \
  57.   HPoint3 edge[2]; int en = 8;                    \
  58.   HPoint3 face[maxfaceverts]; int fn = maxfaceverts*4;        \
  59.   int ppath[maxpathlen]; int ppn = maxpathlen;            \
  60.   int vi;                            \
  61.   int ei[2]; int ein = 2;                    \
  62.   int fi;                            \
  63.                                 \
  64.   LDECLARE(("pick", LBEGIN,                    \
  65.         LSTRING,            &coordsys,        \
  66.         LSTRING,            &id,            \
  67.         LHOLD, LARRAY, LFLOAT,    &point, &pn,        \
  68.         LHOLD, LARRAY, LFLOAT,    &vertex, &vn,        \
  69.         LHOLD, LARRAY, LFLOAT,    edge, &en,        \
  70.         LHOLD, LARRAY, LFLOAT,    face, &fn,        \
  71.         LHOLD, LARRAY, LINT,    ppath, &ppn,        \
  72.         LINT,            &vi,            \
  73.         LHOLD, LARRAY, LINT,    ei, &ein,        \
  74.         LINT,            &fi,            \
  75.         LEND));                        \
  76.                                 \
  77.   if (1) { body };                        \
  78.   return Lt;                            \
  79. }
  80.  
  81.